using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.AddressableAssets;


namespace Dolls
{ 
    /// <summary>
    /// 孵化界面
    /// </summary>
    public class uiDollsHatch : uiMonoBase
    {
        public Text mTimeCapsuleNum;
        public uiDollsHatchNode[] mArr;

        public override void Btn_Open()
        {
            base.Btn_Open();

            RefreshCapsuleNum();

            //检查并剔除某些数据
            cDollsHatch.Inst.RemoveAllHatchFinishDolls();

            //检查是否需要新增数据
            cDollsHatch.Inst.CheckAddNewData();

            //获取数据并刷新界面
            var datas = cDollsHatch.Inst.GetHatchArr();
            for(int i=0; i<cDollsHatchDefine.Const_HatchPageNumMax; i++)
            {
                mArr[i].Init(i);
            }

        }

        public void RefreshCapsuleNum()
        {
            mTimeCapsuleNum.text = cResInst.timeCapsule.ToString();
        }


    }
}
